package com.avic.rong.userOrder.api;

import com.avic.rong.api.HttpPostService;
import com.avic.rong.api.HttpUserService;
import com.example.minato.minastore.BaseApi;
import com.example.minato.minastore.listener.HttpOnNextListener;
import com.trello.rxlifecycle2.components.support.RxAppCompatActivity;

import io.reactivex.Observable;
import okhttp3.MultipartBody;
import retrofit2.Retrofit;

/**
 * Created by XinEr on 2019/8/3.
 * Describe:
 */
public class UploadApi extends BaseApi {
    /*需要上传的文件*/
    private MultipartBody.Part part;
    public MultipartBody.Part getPart() {
        return part;
    }

    public void setPart(MultipartBody.Part part) {
        this.part = part;
    }
    public UploadApi(RxAppCompatActivity rxAppCompatActivity, HttpOnNextListener listener) {
        super(rxAppCompatActivity, listener);
        setCache(false);

    }

    @Override
    public Observable getObservable(Retrofit retrofit) {
        HttpPostService service = retrofit.create(HttpPostService.class);
        return service.uploadProof(getPart());
    }


}
